1. Field of the Invention
This invention relates to a print control technology in application where high print speed is required in a printer, particularly in a serial printer.
2. Description of the Related Art
Some printers can be used at a print quality level selected from among several print quality levels in response to the required print speed. For example, when the printer is set to a standard image quality mode, it prints in 240 dpi; when the printer is set to a high speed mode, it prints in 120 dpi; and when the printer is set to a very high speed mode, it prints in 90 dpi.
Some conventional serial printers are provided each with an image buffer for improving print throughput. The image buffer needs to be related to the pins of an actual print head and thus must be configured in expansion density responsive to the pin cycle of the head. That is, in the standard image quality mode, an image is expanded in 240 dpi; in the high speed mode, an image is expanded in 120 dpi; and in the very high speed mode, an image is expanded in 90 dpi.
By the way, since the host which sends a print instruction to a printer sends data without considering the printer setting, data in different print densities may be mixed in one-line data in the expansion state in the image buffer. When the printer receives such data, the situation is avoided by either of the following methods:
In the first method, when it is determined that data different in print density has been sent, the image expanded so far is printed and the subsequent image is newly expanded.
In the second method, the least common multiple of the different densities mixed in one line is found and an image is expanded in the density. For example, if it is recognized that data in 90 dpi and data in 120 dpi are mixed, the image is expanded in 360 dpi.
Thus, if either the first or second method is adopted, the printing must slow down.
By the way, an area where text or an image does not exist, such as space or a move part of a position specification command, is expanded as a null image pattern (non-print data); if the above-described mixed portion exists in such an area, either the first or second method is used.
If a text pattern or a graphic image pattern exists in parts different in print density, it is impossible to expand it in different print densities on the image buffer. Therefore, the above-described avoidance method must be adopted. However, if information concerning print position setting is only specified in a density different from the current print density set in the printer, it is not necessarily possible to say definitely that the uniform print density corresponding to the pin cycle of the head is required. This point will be discussed below with examples:
FIG. 4 shows an example 40 of print data sent from a host. It indicates that characters A and B of an ANK character set represented in hexadecimal code are printed in spacing of a predetermined amount (represented by ESC/P of a standard printer control code system most frequently used in serial printers). The spacing between the characters A and B is specified in {fraction (36/120)} inches. Assuming that the printer is set to the above-mentioned very high speed mode (90 dpi) when it receives the instruction,       36    /    120    =      27    /    90  
thus, if 27-dot space can be provided on the image buffer, position control similar to that specified from the host can be performed.
FIG. 5 shows a print data example different from the example in FIG. 4 only in character spacing. The spacing between characters A and B is specified in {fraction (31/120)} inches. In this case, when an attempt is made to convert the denominator of {fraction (31/120)} into 90,       31    /    120    =            93      /      360        =                  23        /        90            ⁢              xe2x80x83            ⁢      and      ⁢              xe2x80x83            ⁢      the      ⁢              xe2x80x83            ⁢      remainder      ⁢              xe2x80x83            ⁢      is      ⁢              xe2x80x83            ⁢              1        /        360.            
If the data is, for example, graphic data, it is impossible to print {fraction (1/360)}, namely, {fraction (0.25/190)} dot. However, the spacing relates to the drive amount of a carriage motor for moving a head, thus control dependent on the pin cycle of the head need not necessarily be performed.
Based on the viewpoint, a way can be designed to print at high speed in low resolution even if a printer receives a print instruction containing position specification data of different resolution from that set as the print quality of the printer; such an idea is not involved in the conventional serial printers.
It is therefore an object of the invention to provide a printer capable of continuing to print at high speed even if one-line data sent from a host contains data different in print density.
A printer for solving the problem is a printer for enabling the user to select one of print densities, as described below:
In this invention, there is provided a printer comprising an image buffer for storing unprinted data in a bit image format and a print instruction conversion section for interpreting a received print instruction and executing bit image expansion in the image buffer in the density responsive to the print density selected in the printer. That is, when the printer is set to a print density of 90 dpi, basically bit image expansion is executed in 90 dpi. Upon reception of print-position specification information, which represents a shift distance in any density other than the print density selected by the printer, exceptionally the print instruction conversion section converts the shift distance into that of the selected print density and represents in the image buffer.
In addition to the above-described configuration, in this invention, also included is a line buffer for dividing a received print instruction for each piece of information concerning one-line print scanning which is retained thereby. If print information with the print density selected by the printer and print-position specification information with a shift distance in any other density than selected are mixed in the information concerning one-line print scanning retained in the line buffer, the print instruction conversion section converts the shift distance into the selected print density.
Further, in this invention, also included is error correction means for correcting an error occurring when the print instruction conversion section converts the shift distance into that of the print density. That is, if the print density conversion causes an error to occur between the shift distance, being represented by the print-position specification information, and a shift distance, being represented by bit image data expanded in the image buffer, error correction means is included.
The specific error correction means may be configured as follows: For example, error information is prepared by performing the following calculation: The shift distance of a conversion source represented with a dot pitch value as the denominator and the number of dots as the numerator is multiplied by the dot pitch value of the current print density selected in the printer. If the calculation result does not become an integer, it is recognized that an error occurs. In this case, in the fraction of the calculation result, the integer value part found by dividing the numerator by the denominator is output as the number of dots representing the shift distance of a conversion destination and the remainder found by dividing the numerator by the denominator is output as an error amount.
In this invention, output of the number of dots representing the integer value and output of the error amount corresponding to the remainder are received and blank bits corresponding to the number of dots of the integer value and error correction information responsive to the error amount are expanded in the image buffer. Engine control means reads the error correction information on bit image and drives a print engine, particularly a print head is controlled based on the error correction information.
In this case, if the error correction information is recognized as print data in error and is printed on actual paper, it is inconvenient. To avoid this, in the printer as claimed in claim 6, an area where print information does not exist is provided on the bit image data expanded in the image buffer, and the error correction information is stored in the area where print information does not exist.